<%-- 
    Document   : manageCategories
    Created on : Dec 14, 2009, 2:31:53 PM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="hex" uri="/WEB-INF/hex.tld" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

    </head>
    <body>

        <table border="1">
            <tr>
                <th colspan="3">Manage categories: ${parent.name}</th>
            </tr>
            <c:if test="${!(parent.name eq'root')}">
            <tr>
                <td colspan="3">
                    <form method="post">
                        <span>Rename this category:</span>
                        <input type="text" name="name" value="${parent.name}" />
                        <input type="submit" name="rename" value="Rename" />
                    </form>
                </td>
            </tr>
            </c:if>
            <tr>
                <td colspan="3">
                    ${hex:getNoChildCategoryTreeHTML(parent, '?id=%d')}
                </td>
            </tr>
            <c:forEach var="c" items="${parent.children}" varStatus="counter">
            <tr>
                <td>${counter.count}</td>
                <td><a href="?id=${c.autoId}">${c.name}</a></td>
                <td><form method="post"><input type="hidden" name="removeId" value="${c.autoId}"/><input type="submit" name="remove" value="Remove"/></form></td>
            </tr>
            </c:forEach>

            <tr>
                <td>*</td>
                <td colspan="2">
                    <form method="post">
                        <input type="text" name="name" value="" />
                        <input type="submit" name="add" value="Add new" />
                    </form>
                </td>
            </tr>
        </table>
    </body>
</html>
